﻿/*
* ==============================================================================
*
* FileName: CompanyDto.cs
* Created: 2020/6/08 10:45:49
* Author: Meiam
* Description: 
*
* ==============================================================================
*/
using SqlSugar;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Meiam.System.Model.Dto
{

    /// <summary>
    /// MES数据对象
    /// </summary>
    public class MESmDto : PageParm
    {

        /// <summary>
        /// 描述 :  
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "")]
        public string QueryText { get; set; }

    }
    /// <summary>
    ///  oracle获取的批次信息
    /// </summary>
    public class BatchDto {
        /// <summary>
        /// 描述 : 批次号 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "LOT_NUMBER")]
        public string LOT_NUMBER { get; set; }

        /// <summary>
        /// 描述 : 批次数量 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "TRANSACTION_QUANTITY")]
        public decimal TRANSACTION_QUANTITY { get; set; }

        /// <summary>
        /// 描述 : 物料编码 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "SEGMENT1")]
        public string SEGMENT1 { get; set; }
    }

    [SugarTable("dbo.T_MESTlDetails")]
    /// <summary>
    /// 投料对象
    /// </summary>
    public class MEStlDto
    {
        /// <summary>
        /// 描述 : 工单号 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "mfgordername")]
        public string mfgordername { get; set; }

        /// <summary>
        /// 描述 : 上机日期 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "txndate")]
      
        public string txndate { get; set; }

        /// <summary>
        /// 描述 : 计量单位 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [SugarColumn(IsIgnore =true)]
        [Display(Name = "uom")]

        public string uom { get; set; }
        /// <summary>
        /// 描述 : 批次号 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "LOT_NUMBER")]
        // [SugarColumn(IsIgnore = true)]
        public string LOT_NUMBER { get; set; }
        
        /// <summary>
        /// 描述 : 子仓库 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "SUBINVENTORY_CODE")]
        [SugarColumn(IsIgnore = true)]
        public string SUBINVENTORY_CODE { get; set; }

        /// <summary>
        /// 描述 : 返回内容 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "INTF_MESSAGE")]
        public string INTF_MESSAGE { get; set; }

        /// <summary>
        /// 描述 : 返回状态 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "INTF_STATUS")]
        public string INTF_STATUS { get; set; }

        /// <summary>
        /// 描述 : 工序 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "opnum")]
        [SugarColumn(IsIgnore = true)]
        public string opnum { get; set; }

        /// <summary>
        /// 描述 : 刀号 
        /// 空值 : True
        /// 默认 : 
        /// </summary>
        [Display(Name = "cucutlotid")]
        public string cucutlotid { get; set; }

        /// <summary>
        /// 描述 : 物料编码 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "productname")]
      
        public string productname { get; set; }

        /// <summary>
        /// 描述 : 物料描述 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "description")]
        public string description { get; set; }

        /// <summary>
        /// 描述 : 长度 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "culength")]
        public decimal culength { get; set; }


        /// <summary>
        /// 描述 : 实际长度 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "TRANSACTION_QUANTITY")]
        public decimal TRANSACTION_QUANTITY { get; set; }

        /// <summary>
        /// 描述 : oralce执行事务id 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "TRANSACTION_ID")]
        public string TRANSACTION_ID { get; set; }


        /// <summary>
        /// 描述 : 数量（重量） 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "qty")]
        public decimal qty { get; set; }
        
        ///// <summary>
        ///// listecept方法1
        ///// </summary>
        ///// <param name="obj"></param>
        ///// <returns></returns>
        //public override bool Equals(object obj)
        //{
        //    if (obj is MEStlDto)
        //    {
        //        MEStlDto mEStlDto = obj as MEStlDto;
        //        return cucutlotid == mEStlDto.cucutlotid && mfgordername == mEStlDto.mfgordername && productname == mEStlDto.productname && culength == mEStlDto.culength;
        //    }
        //    return false;
        //}
        //public override int GetHashCode()
        //{
        //    return cucutlotid.GetHashCode() ^ mfgordername.GetHashCode() ^ productname.GetHashCode() ^ culength.GetHashCode();
        //}
    }
    /// <summary>
    /// 比较
    /// </summary>
    public class MesTlComparer1 : IEqualityComparer<MEStlDto>
    {
        public bool Equals(MEStlDto x, MEStlDto y)
        {
            //return x.cucutlotid == y.cucutlotid && x.mfgordername == y.mfgordername && x.productname == y.productname && x.culength == y.culength && y.INTF_STATUS != "COMPLETED";
            return x.cucutlotid == y.cucutlotid && x.mfgordername == y.mfgordername && x.productname == y.productname && x.culength == y.culength;
        }

        public int GetHashCode(MEStlDto obj)
        {
            return obj.cucutlotid.GetHashCode() ^ obj.mfgordername.GetHashCode() ^ obj.productname.GetHashCode() ^ obj.culength.GetHashCode();
        }
    }

    /// <summary>
    /// 比较2
    /// </summary>
    public class MesTlComparer2 : IEqualityComparer<MEStlDto>
    {
        public bool Equals(MEStlDto x, MEStlDto y)
        {
            return  x.productname == y.productname;
        }

        public int GetHashCode(MEStlDto obj)
        {
            return  obj.productname.GetHashCode() ;
        }
    }

    [SugarTable("dbo.T_MESReport")]
    /// <summary>
    /// 投料对象
    /// </summary>
    public class MESReportDto
    {
        /// <summary>
        /// 描述 : 工单号 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "mfgordername")]
        public string mfgordername { get; set; }

        /// <summary>
        /// 描述 : 上机日期 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "txndate")]

        public string txndate { get; set; }

        /// <summary>
        /// 描述 : 计量单位 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "uom")]

        public string uom { get; set; }
        /// <summary>
        /// 描述 : 批次号 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "LOT_NUMBER")]
        // [SugarColumn(IsIgnore = true)]
        public string LOT_NUMBER { get; set; }

        /// <summary>
        /// 描述 : 子仓库 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "SUBINVENTORY_CODE")]
        [SugarColumn(IsIgnore = true)]
        public string SUBINVENTORY_CODE { get; set; }

        /// <summary>
        /// 描述 : 返回内容 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "INTF_MESSAGE")]
        public string INTF_MESSAGE { get; set; }

        /// <summary>
        /// 描述 : 返回状态 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "INTF_STATUS")]
        public string INTF_STATUS { get; set; }

        /// <summary>
        /// 描述 : 工序 
        /// 空值 : False
        /// 默认 : 
        /// </summary>
        [Display(Name = "opnum")]
        [SugarColumn(IsIgnore = true)]
        public string opnum { get; set; }

        /// <summary>
        /// 描述 : 刀号 
        /// 空值 : True
        /// 默认 : 
        /// </summary>
        [Display(Name = "cucutlotid")]
        public string cucutlotid { get; set; }

        /// <summary>
        /// 描述 : 物料编码 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "productname")]

        public string productname { get; set; }

        /// <summary>
        /// 描述 : 物料描述 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "description")]
        public string description { get; set; }

        /// <summary>
        /// 描述 : 长度 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "culength")]
        public decimal culength { get; set; }


        /// <summary>
        /// 描述 : 实际长度 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "TRANSACTION_QUANTITY")]
        public decimal TRANSACTION_QUANTITY { get; set; }

        /// <summary>
        /// 描述 : oralce执行事务id 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "TRANSACTION_ID")]
        public string TRANSACTION_ID { get; set; }


        /// <summary>
        /// 描述 : 数量（重量） 
        /// 空值 : False
        /// 默认 : 1
        /// </summary>
        [Display(Name = "qty")]
        public decimal qty { get; set; }

    }

}
